home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
comm
/
modcmd16.zip
/
MODCMD.DOC
< prev
next >
Wrap
Text File
|
1989-07-14
|
6KB
|
148 lines
MODCMD Version 1.6 by Michael Smith
Documentation by Wayne Morton
INTRODUCTION
------------
This program was written to answer a need to send commands to my modem from
batch files. Sounds simple and easy to do, and there's even a program called
DOSMODEM made to do just that. The problem comes with my computer, because it's
an older model and it's very picky about how you access the COM port and how
you address the modem itself. My modem (a Hayes) igornes commands sent to it
by DOSMODEM, and from the command line (such as "ECHO ATDT5551234 >COM1:")
MODCMD.EXE answers my needs. It's very selective in how it addresses the COM
port and should work on all computers and modems.
HOW TO USE MODCMD
-----------------
The correct usage is:
MODCMD [Port] [String] /[Baud]
[Port] = Either COM1: or COM2: (does not have to be capitilized)
[String] = Any modem string or command
[Baud] = The baud rate you want to set the modem to; be sure to
place the "/" before the rate.
For example: MODCMD COM1: ATZ /1200 would set COM1:'s baud rate to 1200,
then send the "ATZ" reset string to the modem.
The baud rate switch is optional; if you do not specify the baud rate it
will default to 1200. It's important not to include spaces in any of the modem
strings or MODCMD could interpret part of the string to be a baud set command:
WRONG: MODCMD COM2: ATDT 9,5552368 !,#71234
RIGHT: MODCMD COM2: ATDT9,5552368!,#71234;
This instructs the modem to do the following:
ATD Dial command
T Use touch-tone dialing
9 Access a number outside the local PBX
, Pause before dialing
5552368 Dial this phone number
! Perform a hookflash to alert PBX
, Pause before dialing extension
#7 Issue PBX transfer code
1234 Dial extension 1234
; Return modem to command mode after
connecting.
If you are not familiar with the Hayes modem commands you should consult the
instruction book that came with your modem.
To change the baud rate of a serial port without sending any command, use
MODCMD COM1: % /[Baudrate]. The "%" takes the place of a normal hayes command,
therefore it just resets the I/O port, sets the new baud rate, and "wakes up"
the modem, without executing any command (actually, any non-hayes blurb will
do...instead of "%" you could have "do-nothing").
For a summary of the correct usage just type MODCMD without any parameters
following it and it will give you a small help screen.
USES FOR MODCMD
---------------
MODCMD makes a nice "desktop" dialer when written into a simple batch file
like this sample that we'll call DIAL.BAT:
ECHO OFF
IF X%1==X GOTO :BAD
GOTO %1
:NICK
MODCMD COM1: ATDT5551234
GOTO :CONNECT
:MIKE
MODCMD COM1: ATDT55556789
GOTO :CONNECT
:TOM
MODCMD COM1: ATDT5550123
GOTO :CONNECT
:#
MODCMD COM1: ATDT%2
GOTO :CONNECT
:CONNECT
ECHO The modem has dialed %1 %2 pick up the phone and
PAUSE
MODCMD COM1: ATH0
GOTO :END
:BAD
ECHO YOU MUST ENTER THE NAME OR NUMBER THAT YOU WANT TO DIAL
:END
This batch file will allow you to dial by names or numbers. To use it you
would simply type DIAL and the name of the person you want to call. For example
DIAL TOM would cause the batch file to go to the label :TOM and MODCMD would
dial the number 5550123, pause for you to pick up the phone, then hang up. If
you want to dial a number that's not written into the batch file you would just
enter: DIAL # 5551234. The modem will then dial the number and wait the same
way it does when you dial names.
If you don't understand the way the batch file works, read the section in
your DOS manual on writing batch files.
When writing batch files that will issue two or more MODCMD commands in a
row, you will need to issue a WAIT command between them; otherwise the second
command will cancel out the first before the modem has time to respond. For
this reason a copy of the program WAIT.COM has been included with MODCMD. To
use WAIT just use the syntax: WAIT [Number of seconds to wait]
For example:
MODCMD COM1: ATDT5551234
WAIT 8
MODCMD COM1: ATH0
WAIT 3
MODCMD COM1: ATDT5551234
WAIT 8
Without the WAIT commands the modem would hang-up before it completes
dialing the number. With the WAIT it will dial 5551234 then hang up then dial
5551234, etc.
EPILOGUE
--------
Michael wrote MODCMD in C, so it's "pseudo" intelligence would be easier to
impliment (hence the claim "it will work where others won't"). If it absolutely
refuses to work on your setup, drop him a line describing your system setup in
detail, and the exact nature of the problem. He can be reached on THE PRAEDO
BBS at (609) 953-0769; send e-mail to MICHAEL SMITH. You can also leave me a
message on GEnie at the e-mail address of W.MORTON.
MODCMD is COPYRIGHT 1989 by UNICUS ENTERPRISES and is offered to you FREE OF
CHARGE with the condition that the program may not be altered and must include
this documentation and notice in the package. Please feel free to copy this
program and share it with your friends or post it on bulletin boards.
DOSMODEM, and from the command